﻿using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle;
using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle.VehicleConfig;
using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle.VehicleControl;
using JshRCSWebApi.Service.SysVehicle;
namespace JshRCSWebApi.API.Controllers.SysVehicle
{
    public class VehicleControlController : BaseController
    {
        private readonly VehicleControlService _vehicleControlService;
        public VehicleControlController(IHttpContextAccessor httpContextAccessor, VehicleControlService vehicelControlService) : base(httpContextAccessor)
        {
            _vehicleControlService = vehicelControlService;
        }

        /// <summary>
        /// 停止开环运动 2000  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_control_stop_req(RequestDTO requestDTO)
            => await _vehicleControlService.robot_control_stop_req(requestDTO);

        /// <summary>
        /// 重定位 2002   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_control_reloc_req(RequestDTO<robot_control_reloc_DTO> requestDTO)
            => await _vehicleControlService.robot_control_reloc_req(requestDTO);

        /// <summary>
        /// 取消重定位 2004   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_control_cancelreloc_req(RequestDTO requestDTO)
            => await _vehicleControlService.robot_control_cancelreloc_req(requestDTO);

        /// <summary>
        /// 开环运动 2010    
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_control_motion_req(RequestDTO<robot_control_motion_DTO> requestDTO)
            => await _vehicleControlService.robot_control_motion_req(requestDTO);

        /// <summary>
        /// 切换载入的地图 2022     
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_control_loadmap_req(RequestDTO<robot_control_loadmap_DTO> requestDTO)
            => await _vehicleControlService.robot_control_loadmap_req(requestDTO);

    }
}
